/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package facades;

import entities.PublicRelationsCandidate;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Alvaro
 */
@Stateless
public class PublicRelationsCandidateFacade extends AbstractFacade<PublicRelationsCandidate> {
    @PersistenceContext(unitName = "ProyectoPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public PublicRelationsCandidateFacade() {
        super(PublicRelationsCandidate.class);
    }
    
    public List<PublicRelationsCandidate> findByPublicRelationsIdUser(Integer idUser){
        Query q=em.createNamedQuery("PublicRelationsCandidate.findByIdPublicRelacions",PublicRelationsCandidateFacade.class);
        q.setParameter("publicRelationsIdUser", idUser);
        return q.getResultList();
    }
    
}
